package com.ftg.learn.day16.annotationbase;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * 苍蝇
 * Component  把当前类做为组件注入到容器里面
 * @author 布衣
 */
@Data
@Component
@Scope("prototype")
/*
 <bean id="fly" class="com.ftg.learn.day16.annotationbase.fly">
 </bean>
 */
public class Fly {

    @PostConstruct
    @Order(2)
    public void test1(){
        System.out.println("我会不会走");
    }

    @PostConstruct
    @Order(1)
    public void test2(){
        System.out.println("你看我呢?我会不会走");
    }

    public Fly(){
        System.out.println("构造方法");
    }

    @Value("1")
    private Integer id;

    @Value("张三")
    private String name;

}
